<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/taglibs.jsp"%>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@	page import="com.yaodian100.core.common.utils.ServerValue"%>
<script type="text/javascript" charset="UTF-8" src="<%=application.getContextPath() %>/js/jquery.datepick.js"></script>
<script type="text/javascript" charset="UTF-8" src="<%=application.getContextPath() %>/js/jquery.datepick-zh-CN.js"></script>
<script src="<%=application.getContextPath() %>/js/jquery.tooltip.js" type="text/javascript"></script>
<link rel="stylesheet" href="<%=application.getContextPath() %>/css/jquery.tooltip.css" />
<link rel="stylesheet" type="text/css" href="<%=application.getContextPath() %>/css/smoothness.datepick.css" />
<link rel="stylesheet" type="text/css" href="<%=application.getContextPath() %>/css/validator.css" />
<c-rt:set var="midContextPath" value='<%=ServerValue.getMidContextPath()%>'/>
<script language="javascript">
	$().ready( function() {
		$('#tuangouStParam').datepick({buttonImageOnly: true, buttonImage: '../images/calendar.gif',dateFormat:"yy-mm-dd"}); 
		$("tr.tdDesc").tooltip();
		$("#queryPrize").click(function(){
			var chkRequired = new Array("prizeIdParam","tuangouIdParam","prizeMobileParam","prodNameParam","loginIdParam");
			var isValid = false;
			for (var i=0;i<chkRequired.length;i++) {
				var id = chkRequired[i];
				if ($.trim($("#"+id).val()) != "") {
					isValid = true;
					break;
				}
			}
			if (!isValid) {
				alert("此功能必须输入以下任一栏位: \r\n抽奖编号 / 团购编号 / 手机号码/\r\n 商品名称 / 会员帐号 ");				
			}else{	
				$("#prizeQuery").attr("action","queryPrize.do");
				$("#prizeQuery").submit();
			}	
		});
		
	});
	function customRange (){
		var startDt = $('#tuangouStParam').val(); //起始日
		return {minDate:endDt,maxDate: new Date(${today})}; 
	}
</script>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<br />
<h1>抽奖活动查询</h1>
<br />
<div class="data-form"><s:form action="queryPrize.do" method="post" id="prizeQuery">
	<b>抽奖编号：</b>
	<input name="prizeIdParam" type="text" id="prizeIdParam"
		value="${prizeIdParam}" size="20" maxlength="20">
	<b>团购编号：</b>
	<input name="tuangouIdParam" type="text" id="tuangouIdParam"
		value="${tuangouIdParam}" size="20" maxlength="20">
	<b>活动日期：</b>
	<input name="tuangouStParam" type="text" id="tuangouStParam"
		value="${tuangouStParam}" size="10" maxlength="10">
	<b>手机号码：</b>
	<input type="text" name="prizeMobileParam" id="prizeMobileParam" value="${prizeMobileParam}" size="15" maxlength="15"/>	
	<br/>
	<b>商品名称：</b>
	<input name="prodNameParam" id="prodNameParam" type="text" title="商品名称" size="30" value="${prodNameParam}">
	<b>会员帐号</b>
	<input type="text" name="loginIdParam" id="loginIdParam" value="${loginIdParam}" size="15" maxlength="15"/>	
	<input type="button" value="查寻" id="queryPrize" />	
</s:form>
</div>
<br/><br/><br/>
<s:if test="orderPrizeList.size > 0">
	<yaodian100:pageutil link="queryPrize.do" pagerObj="${pager}" />
	<table class="tb-1" width="100%">
		<thead>
			<tr>
				<th>抽奖编号</th>
				<th>团购编号</th>
				<th>商品名称</th>
				<th>订购日期</th>
				<th>活动日期</th>
				<th>会员</th>
				<th>手机号码</th>
				<th>所在城市</th>
				<th>售价</th>
				<th>渠道</th>
			</tr>
		</thead>
		<tbody>
		
			<c:forEach items="${orderPrizeList}" var="orderPrize" varStatus="rows_index">
			<tr class="${orderPrize[13] == '01'? 'bg-rd' : ''}">
				<td>${orderPrize[0]}</td>
				<td><a href="<%=ServerValue.getFrontHostname()%><%=ServerValue.getFrontContextPath()%>/tuangou/product.do?tuangouId=${orderPrize[1]}" target="blank">${orderPrize[1]}</a>
				</td>
				<td>${orderPrize[3]}</td>
				<td><fmt:formatDate value="${orderPrize[4]}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<td>
					<fmt:formatDate value="${orderPrize[5]}" pattern="yyyy-MM-dd HH:mm:ss" /><br/>
					<fmt:formatDate value="${orderPrize[6]}" pattern="yyyy-MM-dd HH:mm:ss" />
				</td>
				<td><a href="${midContextPath}/member/view.do?memberId=${orderPrize[12]}" />${orderPrize[7]}</a>
				
				</td>
				<td>${orderPrize[8]}</td>
				<td>${orderPrize[9]}</td>
				<td>${orderPrize[10]}</td>
				<td>${orderPrize[11]}</td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
	<yaodian100:pageutil link="queryPrize.do" pagerObj="${pager}" />
</s:if>
<br /><br /><br />
